﻿namespace Sidvall.AuthorizationManager.Data.Entity.Entities
{
    public partial class AuthorizationScopeUser : global::Sidvall.Data.DataRowBase, global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser
    {
        #region Public Members

        #region AccessTime

        private System.Nullable<System.DateTime> _AccessTime;
        public System.Nullable<System.DateTime> AccessTime
        { 
            get
            {
                return _AccessTime;
            }
            set
            {
                _AccessTime = Sidvall.Business.ValidationManager.GetValidUniversalDateTime(value, System.DateTimeKind.Utc);
            }
        }

        #endregion
        #region AuthorizationScopeId

        private long _AuthorizationScopeId;
        public long AuthorizationScopeId
        { 
            get
            {
                return _AuthorizationScopeId;
            }
            set
            {
                _AuthorizationScopeId = value;
            }
        }

        #endregion
        #region CreatedTime

        private System.DateTime _CreatedTime;
        public System.DateTime CreatedTime
        { 
            get
            {
                return _CreatedTime;
            }
            set
            {
                _CreatedTime = Sidvall.Business.ValidationManager.GetValidUniversalDateTime(value, System.DateTimeKind.Utc);
            }
        }

        #endregion
        #region IsActive

        private bool _IsActive;
        public bool IsActive
        { 
            get
            {
                return _IsActive;
            }
            set
            {
                _IsActive = value;
            }
        }

        #endregion
        #region UpdatedTime

        private System.DateTime _UpdatedTime;
        public System.DateTime UpdatedTime
        { 
            get
            {
                return _UpdatedTime;
            }
            set
            {
                _UpdatedTime = Sidvall.Business.ValidationManager.GetValidUniversalDateTime(value, System.DateTimeKind.Utc);
            }
        }

        #endregion
        #region UserClaims

        private string _UserClaims;
        public string UserClaims
        { 
            get
            {
                return _UserClaims;
            }
            set
            {
                _UserClaims = value;
            }
        }

        #endregion
        #region UserContext

        private string _UserContext;
        public string UserContext
        { 
            get
            {
                return _UserContext;
            }
            set
            {
                _UserContext = value;
            }
        }

        #endregion
        #region UserId

        private string _UserId;
        public string UserId
        { 
            get
            {
                return _UserId;
            }
            set
            {
                _UserId = value;
            }
        }

        #endregion
        
        public virtual Sidvall.AuthorizationManager.Data.Entity.Entities.AuthorizationScope AuthorizationScope { get; set; }
        
        #region DataRowContextStorageKey

        protected override string DataRowContextStorageKey
        {
            get
            {
                return global::Sidvall.AuthorizationManager.Data.Entity.SystemContext.Current.EntityFacade.AuthorizationScopeUserManager.GetKey(this);
            }
        }

        #endregion
        #region DataRowStateIsDirty

        protected override bool DataRowStateIsDirty
        {
            get
            {
                return global::Sidvall.AuthorizationManager.Data.Entity.SystemContext.Current.EntityFacade.AuthorizationScopeUserManager.DataRowStateIsDirty(this);
            }
        }

        #endregion

        #region IAuthorizationScopeUser Members

        System.Nullable<System.DateTime> global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.AccessTime
        {
            get
            {
                return this._AccessTime;
            }
            set
            {
                this.AccessTime = value;
            }
        }
        long global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.AuthorizationScopeId
        {
            get
            {
                return this._AuthorizationScopeId;
            }
            set
            {
                this.AuthorizationScopeId = value;
            }
        }
        System.DateTime global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.CreatedTime
        {
            get
            {
                return this._CreatedTime;
            }
            set
            {
                this.CreatedTime = value;
            }
        }
        bool global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.IsActive
        {
            get
            {
                return this._IsActive;
            }
            set
            {
                this.IsActive = value;
            }
        }
        System.DateTime global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.UpdatedTime
        {
            get
            {
                return this._UpdatedTime;
            }
            set
            {
                this.UpdatedTime = value;
            }
        }
        string global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.UserClaims
        {
            get
            {
                return this._UserClaims;
            }
            set
            {
                this.UserClaims = value;
            }
        }
        string global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.UserContext
        {
            get
            {
                return this._UserContext;
            }
            set
            {
                this.UserContext = value;
            }
        }
        string global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.UserId
        {
            get
            {
                return this._UserId;
            }
            set
            {
                this.UserId = value;
            }
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        IAuthorizationScope global::Sidvall.AuthorizationManager.Data.IAuthorizationScopeUser.AuthorizationScope
        {
            get
            {
                return this.AuthorizationScope;
            }
            set
            {
                this.AuthorizationScope = value as AuthorizationScope;
            }
        }

        #endregion

        #endregion
        #region Constructors

        public AuthorizationScopeUser() : this(false, null, null)
        {
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public AuthorizationScopeUser(bool initializeChildren, Sidvall.Data.IDataRowContextProvider context, Sidvall.Data.DataRowState? dataRowState)
        {
            if ((context != null) || (dataRowState != null))
                SetDataRowContext(context, dataRowState);
            if (initializeChildren)
            {
            }
        }

        #endregion
    }
}